var ajaxUrl = require('../url.js');

function ajaxp(url,val,caozuo) {
  wx.request({
    method: "POST",
    url: ajaxUrl() + url,
    dataType: 'json',
    header: {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    data: val,
    success: function (data) {
      success(data)
    }, error: function (data) {
      fail(data)      
    }
  })
}

export { ajaxp }